﻿using System.Collections.Generic;

namespace SixthSense
{
    class MaterialInfo
    {
        private string _Name;
        private int _Workmanship;
        private int _ID;

        public MaterialInfo Copy()
        {
            return (MaterialInfo)this.MemberwiseClone();
        }

        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
            }
        }

        public int Workmanship
        {
            get
            {
                return _Workmanship;
            }
            set
            {
                _Workmanship = value;
            }
        }

        public int ID
        {
            get
            {
                return _ID;
            }
            set
            {
                _ID = value;
            }
        }
    }

    class MaterialInfoList : List<MaterialInfo>
    {
        public MaterialInfo FindByName(string Item)
        {
            MaterialInfo FoundAlert = this.Find(o => o.Name == Item);

            return FoundAlert;
        }

        public MaterialInfo FindById(int Id)
        {
            MaterialInfo FoundAlert = this.Find(o => o.ID == Id);

            return FoundAlert;
        }

        public MaterialInfoList Copy()
        {
            return (MaterialInfoList)this.MemberwiseClone();
        }
    }
}
